package tech.pdai.springframework.support;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MyClassPathXmlApplicationContext extends ClassPathXmlApplicationContext {

    public MyClassPathXmlApplicationContext(String configLocation) throws BeansException {
        super(new String[]{configLocation}, true, (ApplicationContext)null);
    }

    @Override
    protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
        System.out.println("MyClassPathXmlApplicationContext.postProcessBeanFactory()");
    }

    /**
     * prepareRefresh()中会来调用
     */
    @Override
    protected void initPropertySources() {
        System.out.println("MyClassPathXmlApplicationContext.initPropertySources()");
    }
}
